From 9c28c1b8b9f6cfaaa1eb998fe9a4cc28a9a42dcd Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Tue, 1 Jul 2008 11:38:51 +0100 Subject: [PATCH] ioemu: limit xen-console buffering Set dom->buffer.max_capacity to xend configured limit. Signed-off-by: Pat Campbell --- tools/ioemu/hw/xen_console.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/ioemu/hw/xen_console.c b/tools/ioemu/hw/xen_console.c index fbd33f07fc..92c424740a 100644 --- a/tools/ioemu/hw/xen_console.c +++ b/tools/ioemu/hw/xen_console.c @@ -160,16 +160,18 @@ int xs_gather(struct xs_handle *xs, const char *dir, ...) static int domain_create_ring(struct domain *dom) { - int err, remote_port, ring_ref, rc; + int err, remote_port, ring_ref, limit, rc; err = xs_gather(dom->xsh, dom->serialpath, "ring-ref", "%u", &ring_ref, "port", "%i", &remote_port, + "limit", "%i", &limit, NULL); if (err) { err = xs_gather(dom->xsh, dom->conspath, "ring-ref", "%u", &ring_ref, "port", "%i", &remote_port, + "limit", "%i", &limit, NULL); if (err) { fprintf(stderr, "Console: failed to find ring-ref/port yet\n"); @@ -178,7 +180,9 @@ static int domain_create_ring(struct domain *dom) dom->use_consolepath = 1; } else dom->use_consolepath = 0; - fprintf(stderr, "Console: got ring-ref %d port %d\n", ring_ref, remote_port); + dom->buffer.max_capacity = limit; + fprintf(stderr, "Console: got ring-ref %d port %d limit %d\n", + ring_ref, remote_port, limit); if ((ring_ref == dom->ring_ref) && (remote_port == dom->remote_port)) goto out; -- 2.30.2